import Vue from 'vue'
import VueRouter from 'vue-router'
import login from '@/views/login'
import home from '@/views/home'
import my from '@/views/my'
import qa from '@/views/qa'
import video from '@/views/video/index.vue'
import layout from '@/views/layout/index.vue'
Vue.use(VueRouter)

const router = new VueRouter({
  routes: [
    {
      path: '/login',
      component: login,
    },
    {
      path: '/',
      redirect: '/layout',
    },
    {
      path: '/layout',
      component: layout,
      children: [
        {
          path: 'home',
          component: home,
        },
        {
          path: 'my',
          component: my,
        },
        {
          path: 'qa',
          component: qa,
        },
        {
          path: 'video',
          component: video,
        },
      ],
    },
  ],
})

export default router
